package com.baidu.common.net;

import java.io.File;

public class HttpRequestData {
    
    protected String url;
    protected String urlShort;
    protected byte[] data;
    protected String encode = "utf-8";
    protected boolean get = true;
    private String cookie;
    protected boolean gzip = true;
    public static String userAgent = null;
    
    private boolean isImageRequest = false;
    private File file;
    
    public File getFile() {
        return file;
    }
    
    public void setFile(File file) {
        this.file = file;
    }
    
    public String getShortUrl() {
        return urlShort;
    }
    
    public boolean isImageRequest() {
        return isImageRequest;
    }
    
    public void setImageRequest(boolean isImageRequest) {
        this.isImageRequest = isImageRequest;
    }
    
    public boolean isGzip() {
        return gzip;
    }
    
    public void setGzip(boolean gzip) {
        this.gzip = gzip;
    }
    
    protected boolean appUrl = true;
    
    /**
     * 是否是我们自己服务器的请求，默认“是”
     * 
     * @return
     */
    public boolean isAppUrl() {
        return appUrl;
    }
    
    /**
     * 
     * @param appUrl  是否是离线宝内部的接口，如果是，参数会以离线宝约定的规则传递
     */
    public void setAppUrl(boolean appUrl) {
        this.appUrl = appUrl;
        if (!appUrl) {
            this.gzip = false;
        }
    }
    
    private boolean isKeep = false;
    
    public void setKeepLive(boolean b) {
        this.isKeep = b;
    }
    
    public boolean getKeepLive() {
        return this.isKeep;
    }
    
    public String getEncode() {
        return encode;
    }
    
    public void setEncode(String encode) {
        this.encode = encode;
    }
    
    public String getUrl() {
        return url;
    }
    
    public void setUrl(String url) {
        this.url = url;
    }
    
    public byte[] getData() {
        return data;
    }
    
    public void setData(byte[] data) {
        this.data = data;
    }
    
    public boolean isGet() {
        return get;
    }
    
    public void setGet(boolean get) {
        this.get = get;
    }
    
    public void setCookie(String coo) {
        this.cookie = coo;
    }
    
    public String getCookie() {
        return this.cookie;
    }
    
    public String toString(boolean post) {
        return "";
    }
}
